package com.king.framework.base.domain;

import java.util.Date;

import org.springframework.data.annotation.Id;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;

/**
 * 公用实体类
 * @author lenovo
 *
 */
public class YyBaseEntity {

	// IdType.ASSIGN_ID （默认）基于雪花算法的策略生成数据 id ，与数据库 id 是否设置自增无关
	// IdType.AUTO使用数据库的自增策略，注意，该类型请确保数据库设置了 id 自增，否则无效
	@JsonSerialize(using= ToStringSerializer.class)
	@Id
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

	@JsonSerialize(using= ToStringSerializer.class)
	@TableField("groupid")
	private Long groupid;

	@JsonSerialize(using= ToStringSerializer.class)
	@TableField("cr")
	private Long cr;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@TableField("cts")
	private Date cts;

	@JsonSerialize(using= ToStringSerializer.class)
	@TableField(value="mr")
	private Long mr;

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	@TableField("mts")
	private Date mts;

	@TableLogic(value = "1", delval = "0")
	@TableField("ss")
	private Integer ss;//删除状态,0删除,1整除

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	
	public Long getGroupid() {
		return groupid;
	}

	public void setGroupid(Long groupid) {
		this.groupid = groupid;
	}

	public Long getCr() {
		return cr;
	}

	public void setCr(Long cr) {
		this.cr = cr;
	}

	public Date getCts() {
		return cts;
	}

	public void setCts(Date cts) {
		this.cts = cts;
	}

	public Long getMr() {
		return mr;
	}

	public void setMr(Long mr) {
		this.mr = mr;
	}

	public Date getMts() {
		return mts;
	}

	public void setMts(Date mts) {
		this.mts = mts;
	}

	public Integer getSs() {
		return ss;
	}

	public void setSs(Integer ss) {
		this.ss = ss;
	}
	
	
	
}
